package com.teacher.pc.controller;

import com.teacher.common.CommonResult;
import com.teacher.pojo.vo.all.ClassLevelGetVo;
import com.teacher.pojo.vo.all.ProjectItem;
import com.teacher.service.IAllService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/pc/all")
@Api(tags = "汇总表")
public class AllController {

    @Autowired
    private IAllService iAllService;


    /**
     * 查询本学期成绩表
     *
     * @return
     */
    @ApiOperation("查询本学期成绩表")
    @GetMapping("/currentTerm")
    public CommonResult<List<ProjectItem>> getCurrentTermData(String studentKey) {
        return iAllService.getCurrentTermData(studentKey);
    }

    /**
     * 查询班级排名表
     *
     * @param classId
     * @return
     */
    @ApiOperation("查询班级排名表")
    @GetMapping("/byClassId/{classId}")
    public CommonResult<List<ClassLevelGetVo>> getLevelByClassId(@PathVariable("classId") Long classId) {
        return iAllService.getLevelByClassId(classId);
    }

}
